/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//判定是否登录，没有则转到登录界面
   var c  = $.cookie('loginId');
             if(!c){
                 document.location="security/login.html";
             }
             

$(document).ready(function(){
    
    if(c!=='admin'){
   //将没有权限的按钮禁用
    $('.authcontrol').linkbutton('disable');
    
    //把有权限的再设为可用
    var url = '../api/uiResource2?loginId='+c;
   // alert(url);
    $.get(url,null,function(re){
    //    alert(re);
        for(var i=0;i<re.length;i++){
            var cl = re[i].cssClass; //得到次源的class
            if(cl){
               // alert(cl);
                 $('.'+cl).linkbutton('enable');
              }
        }
        
    });
    }

}
);
